package com.rui.service.impl;

import com.rui.dao.SubjectDao;
import com.rui.entity.Subject;
import com.rui.service.SubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * Created by Administrator on 2017/4/14.
 */
@Service
public class SubjectServiceImpl implements SubjectService{

    @Autowired
    private SubjectDao subjectDao;

    public void add(Subject subject) {
        subjectDao.add(subject);
    }

    public void delete(Integer id) {
        subjectDao.delete(id);
    }

    public void update(Subject subject) {
        subjectDao.update(subject);
    }

    public Subject findOne(Integer id) {
        return subjectDao.findOne(id);
    }

    public List<Subject> findSubjects(String name, Integer pageSize, Integer pageIndex) {
        return subjectDao.findSubjects(name,pageSize,pageIndex);
    }

    public Integer findTotalPage(String name, Integer pageSize) {
        return subjectDao.findTotalPage(name,pageSize);
    }

    public Subject findByName(String name) {
        return subjectDao.findByName(name);
    }

    public List<Subject> findSubjects(String name, Integer id) {
        return subjectDao.findSubjects(name,id);
    }
}
